package cn.zjitc.controller;

import cn.zjitc.entity.PageResult;
import cn.zjitc.entity.QueryPageBean;
import cn.zjitc.pojo.User;
import cn.zjitc.service.AdminReturnService;
import cn.zjitc.service.UserReturnService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/userreturn")
public class UserReturnController {
    @Reference
    private UserReturnService userReturnService;

    //分页查询
    @RequestMapping("/findPage")
    public PageResult findPage(HttpSession session,@RequestBody QueryPageBean queryPageBean){
        User user = (User) session.getAttribute("user");
        Integer id=user.getUser_id();
        queryPageBean.setQueryString(String.valueOf(id));
        PageResult pageResult= userReturnService.pageQuery(queryPageBean);
        return pageResult;
    }
}
